import { GaRegExp, ruleInject, ruleInjectable } from "../InjectionRule";
import { blankRemove } from "../methods/blank-remove";
import { MakeListRule } from "../methods/make-list";

@ruleInjectable()
export default class hashMapRule extends GaRegExp {

	@ruleInject() private variableNameRule!: GaRegExp;

	@ruleInject() private calcRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			"\\{", this.Supply("HASH_MAP"), ...MakeListRule(["(", this.variableNameRule, ")", blankRemove, "(-=|:)", blankRemove, "(", this.calcRule, ")"]), "\\}",
		]);
	}

}
